package com.zte.claa.inficombo.csa.app.service.rptparse.ext;

import java.sql.Date;

public class RptRawData {
	public static final String INVALID_DEVEUI = "NA";
	
	private String deveui;
	private String devName;
	private String projectid;
	private String appeui;
	private String devtype;
	private String portStr;
	private long rptTime = 10000;
	private byte[] payload;
	
	public RptRawData(){
		
	}

	public RptRawData(String devEui){
		this.deveui = devEui;
	}

	public String getDeveui() {
		return deveui;
	}

	public void setDeveui(String deveui) {
		this.deveui = deveui;
	}

	public String getDevName() {
		return devName;
	}

	public void setDevName(String devName) {
		this.devName = devName;
	}

	public String getPortStr() {
		return portStr;
	}

	public void setPortStr(String portStr) {
		this.portStr = portStr;
	}

	public String getProjectid() {
		return projectid;
	}

	public void setProjectid(String projectid) {
		this.projectid = projectid;
	}

	public String getAppeui() {
		return appeui;
	}

	public void setAppeui(String appeui) {
		this.appeui = appeui;
	}

	public String getDevtype() {
		return devtype;
	}

	public void setDevtype(String devtype) {
		this.devtype = devtype;
	}

	public long getRptTime() {
		return rptTime;
	}

	public void setRptTime(long rptTime) {
		this.rptTime = rptTime;
	}

	public byte[] getPayload() {
		return payload;
	}

	public void setPayload(byte[] payload) {
		this.payload = payload;
	}
		
	public String toString(){
		int dataLen = (this.payload == null) ? 0 : this.payload.length;
		StringBuffer sb = new StringBuffer();
		sb.append("deveui=").append(deveui).append(",");
		sb.append("projectid=").append(projectid).append(",");
		sb.append("appeui=").append(appeui).append(",");
		sb.append("devtype=").append(devtype).append(",");
		sb.append("rptTime=").append(new Date(rptTime).toString()).append(",");
		sb.append("dataLen=").append(dataLen);		
		return sb.toString();		
	}
}
